import request from '@/utils/request'

export function getDepartments() {
  return request.get('/company/department')
}

// 获取弹框员工信息
export function getSimple() {
  return request.get('/sys/user/simple')
}

// 添加
export function addDepartments(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}

// 删除
export function delDepartment(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}

// 数据回填获取的数据
export function getDepartment(id) {
  return request.get(`/company/department/${id}`)
}

// 编辑
export function updataDepartment(data) {
  return request.put(`/company/department/${data.id}`, data)
}
